﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace Mercator2.UI
{
    public partial class Driver : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            string ID = this.txtDriverName.Text;//"9661112308";//your datakey value here;       //your "s" string variable

            DataView dv = (DataView)DriverDataSource.Select(DataSourceSelectArguments.Empty);
            if (dv != null)
            {
                dv.Sort = "DriverName";       //this should be the primary key - may have to change it appropriately
                int index = dv.Find(ID);
                if (index >= 0)
                {
                    DetailsView1.PageIndex = index;
                    DetailsView1.DataBind();
                }
            }
        }
    }
}